package br.usp.ime.dojo.client;

import java.util.List;

import com.google.gwt.user.client.rpc.IsSerializable;

public class DojoRoomDTO  implements IsSerializable{
	private String name;
	private String description;
	private boolean started;
	private String language;
	private List<UserDTO> users;
	private UserDTO creator;
	
	public void setName(String name) {
		this.name = name;
	}
	public String getName() {
		return name;
	}
	public void setDescription(String description) {
		this.description = description;
	}
	public String getDescription() {
		return description;
	}
	public String getLanguage() {
		return language;
	}
	public void setStarted(boolean started) {
		this.started = started;
	}
	public boolean isStarted() {
		return started;
	}
	public void setUsers(List<UserDTO> users) {
		this.users = users;
	}
	public List<UserDTO> getUsers() {
		return users;
	}
	public void setLanguage(String language) {
		this.language = language;
	}
	
	@Override
	public boolean equals(Object obj) {
		if (obj instanceof DojoRoomDTO) {
			DojoRoomDTO dojoRoomDTO = (DojoRoomDTO) obj;
			if (dojoRoomDTO.getName().equals(this.name) && dojoRoomDTO.getDescription().equals(this.description) && dojoRoomDTO.getLanguage().equals(this.language)) {
				return true;
			}
		}
		return false;
	}
	
	
	@Override
	public int hashCode() {
		return this.getName().hashCode() * 3 + this.getDescription().hashCode() * 5 + this.getLanguage().hashCode() * 7;
	}
	
	public void setCreator(UserDTO creator) {
		this.creator = creator;
	}
	
	public UserDTO getCreator() {
		return this.creator;
	}
}
